#pragma once
#include <QGraphicsObject>
#include <QPainter>
#include <QRectF>
#include "MyMap_global.h"
#include "TileKey.h"
class MyTileGraphicsItem :public QGraphicsObject
{
	Q_OBJECT
public:
	MyTileGraphicsItem();
	~MyTileGraphicsItem();

	virtual  QRectF boundingRect()const;
	virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR);
	 void SetPath(QString& pngPath);
private:
	QRectF m_boundingRect;
	QPixmap *m_pTilePng;
	QString m_pngPath;
public:
	TileKey m_tilekey;
	bool m_bIsLoaded;
};

